package ar.uba.fi.taller2.ftrs.parser;
	
import java.io.*;
import java.util.ArrayList;

public class TextParser extends Parser{
	
	private String fileName;
	
	public TextParser(String name) {	
		this.fileName = name;
	}
	
public void parsear() throws Exception{
	this.parsear(this.defaultLanguage);
}
	
public void parsear(String lang)throws Exception{
		//Leo el Archivo
    	 BufferedReader in = new BufferedReader(new FileReader(this.fileName));
    	 if (!in.ready())
    		 throw new IOException();
    	String fileContent="",line;	    	
		while ( (line=in.readLine()) != null) {
			fileContent+=line;
		}		
 	    in.close();
 	    // Parseo el Texto Obtenido
		super.parsear(lang, fileContent);		
	}			

public static void main(String args[]){
	 TextParser txt = new TextParser("/tmp/test.txt");
	 try{
	 txt.parsear();
	 }
	 catch(Exception e){
		 System.out.println(e);
	 }
}

}
